import http from './index'

// 获取一级分类信息(首页快速分类导航)
export const getHomeCate = () => http({
	url: '/getcate'
})

// 获取商品全部分类信息(全部分类，数据呈递归树状)
export const getCates = () => http({
	url: '/getcates'
})

// 轮播图
export const getBanner = () => http({
	url: '/getbanner'
})

// 限时秒杀信息(首页)
export const getSeckill = () => http({
	url: '/getseckill'
})

// 获取商品信息(首页)
export const Gethortgoods = () => http({
	url: '/gethortgoods'
})

// 搜索
export const getsearch = (data) => http({
	url: '/search',
	data
})

// 获取分类的商品
export const getgoodlist = (data) => http({
	url: '/getgoodlist',
	data
})

// 详情
export const detail = (data) => http({
	url: '/getgoodsinfo',
	data
})

// 购物车列表
export const cartList = (data, header) => http({
	url: '/cartlist',
	data,
	header
})

// 购物车添加
export const addcart = (data, header) => http({
	url: '/cartadd',
	method: 'post',
	data,
	header
})
// 购物车修改
export const editcart = (data, header) => http({
	url: '/cartedit',
	method: 'post',
	data,
	header
})

// 购物车删除
export const delcart = (data, header) => http({
	url: '/cartdelete',
	method: 'post',
	data,
	header
})

// 订单生成
export const orderAdd = (data, header) => http({
	url: '/orderadd',
	method: 'post',
	data,
	header
})

// 地址查询
export const addresslist = (data, header) => http({
	url: '/addresslist',
	data,
	header
})
// 地址添加
export const addressadd = (data, header) => http({
	url: '/addressadd',
	method: 'post',
	data,
	header
})

// 地址编辑
export const addressedit = (data, header) => http({
	url: '/addressedit',
	method: 'post',
	data,
	header
})
// 地址删除
export const addressdel = (data, header) => http({
	url: '/addressremove',
	method: 'post',
	data,
	header
})

// 发送短信验证码
export const SendSMS = (data) => http({
	url: '/sms',
	data
})

// 微信小程序短信登录
export const smsLogin = (data) => http({
	url: '/smslogin',
	method: 'post',
	data
})

// 微信一键登录
export const wxLogin = data => http({
	url: '/wxlogin',
	method: 'post',
	data
})
